package io;

import java.io.*;

public class TestPrint {
    public static void main(String[] args) throws IOException {
        PrintWriter printWriter = new PrintWriter(new FileWriter("d:/test.txt"));
        printWriter.print("abcdefg");
        printWriter.close();
        PrintStream out = System.out;
        out.print("abcdefg");
        BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream("d:/test.txt"));
        outputStream.write("123456".getBytes());
        outputStream.close();
    }
}
